package com.moyq5.spring.boot.app.register;

import com.moyq5.spring.boot.app.register.server.AppInfoNotifier;
import com.moyq5.spring.boot.app.register.server.AppInfoRegisterServerFactory;

/**
 * 默认任务组实现
 * @author Moyq5
 * @date 2019年2月27日
 */
public class AppGroupDefault implements AppGroup {

	private String groupId;
	private AppStore store = new AppStoreDefault();
	private AppInfoNotifier notifier = AppInfoRegisterServerFactory.getConfig().getNotifier();
	
	public AppGroupDefault(String groupId) {
		this.groupId = groupId;
	}
	
	public AppGroupDefault(String groupId, AppInfoNotifier notifier) {
		this.groupId = groupId;
		this.notifier = notifier;
	}
	
	public AppGroupDefault(String groupId, AppInfoNotifier notifier, AppStore store) {
		this.groupId = groupId;
		this.store = store;
		this.notifier = notifier;
	}
	
	@Override
	public String groupId() {
		return groupId;
	}

	@Override
	public AppStore getStore() {
		return store;
	}

	@Override
	public AppInfoNotifier getNotifier() {
		return notifier;
	}

	@Override
	public void setStore(AppStore store) {
		this.store = store;
	}

	@Override
	public void setNotifier(AppInfoNotifier notifier) {
		this.notifier = notifier;
	}

}
